$(document).ready(function () {

	$('#enabled0').bootstrapSwitch({
		onText: "启用",      // 设置ON文本  
		offText: "禁用",    // 设置OFF文本  
		//onColor : "success",// 设置ON文本颜色(info/success/warning/danger/primary)  
		//offColor : "warning",  // 设置OFF文本颜色 (info/success/warning/danger/primary)  
		size: "small",    // 设置控件大小,从小到大  (mini/small/normal/large)  
		// 当开关状态改变时触发  
		onSwitchChange: function (event, state) {
			if (state == true) {
				document.getElementById("description0").setAttribute('readonly', true);
				document.getElementById("ipaddr0").setAttribute('readonly', true);
				document.getElementById("classifiy_tasks0").setAttribute('disabled', true);
				document.getElementById("store_tasks0").setAttribute('disabled', true);
			} else {
				document.getElementById("description0").readOnly=false;
				document.getElementById("ipaddr0").readOnly=false;
				document.getElementById("classifiy_tasks0").disabled=false;
				document.getElementById("store_tasks0").disabled=false;
			}
		}
	});

	$('#enabled1').bootstrapSwitch({
		onText: "启用",      // 设置ON文本  
		offText: "禁用",    // 设置OFF文本  
		//onColor : "success",// 设置ON文本颜色(info/success/warning/danger/primary)  
		//offColor : "warning",  // 设置OFF文本颜色 (info/success/warning/danger/primary)  
		size: "small",    // 设置控件大小,从小到大  (mini/small/normal/large)  
		// 当开关状态改变时触发  
		onSwitchChange: function (event, state) {
			if (state == true) {
				document.getElementById("description1").setAttribute('readonly', true);
				document.getElementById("ipaddr1").setAttribute('readonly', true);
				document.getElementById("classifiy_tasks1").setAttribute('disabled', true);
				document.getElementById("store_tasks1").setAttribute('disabled', true);
			} else {
				document.getElementById("description1").readOnly=false;
				document.getElementById("ipaddr1").readOnly=false;
				document.getElementById("classifiy_tasks1").disabled=false;
				document.getElementById("store_tasks1").disabled=false;
			}
		}
	});

	$('#enabled2').bootstrapSwitch({
		onText: "启用",      // 设置ON文本  
		offText: "禁用",    // 设置OFF文本  
		//onColor : "success",// 设置ON文本颜色(info/success/warning/danger/primary)  
		//offColor : "warning",  // 设置OFF文本颜色 (info/success/warning/danger/primary)  
		size: "small",    // 设置控件大小,从小到大  (mini/small/normal/large)  
		// 当开关状态改变时触发  
		onSwitchChange: function (event, state) {
			if (state == true) {
				document.getElementById("description2").setAttribute('readonly', true);
				document.getElementById("ipaddr2").setAttribute('readonly', true);
				document.getElementById("classifiy_tasks2").setAttribute('disabled', true);
				document.getElementById("store_tasks2").setAttribute('disabled', true);
			} else {
				document.getElementById("description2").readOnly=false;
				document.getElementById("ipaddr2").readOnly=false;
				document.getElementById("classifiy_tasks2").disabled=false;
				document.getElementById("store_tasks2").disabled=false;
			}
		}
	});

	document.getElementById("description0").value = "速率40Gbps，面板从左至右4号接口";
	document.getElementById("ipaddr0").value = "192.168.1.100";
	document.getElementById("classifiy_tasks0").value = "4";
	document.getElementById("store_tasks0").value = "3";

	document.getElementById("description1").value = "速率40Gbps，面板从左至右3号接口";
	document.getElementById("ipaddr1").value = "192.168.2.100";
	document.getElementById("classifiy_tasks1").value = "4";
	document.getElementById("store_tasks1").value = "3";

	document.getElementById("description2").value = "速率40Gbps，面板从左至右2号接口";
	document.getElementById("ipaddr2").value = "192.168.3.100";
	document.getElementById("classifiy_tasks2").value = "4";
	document.getElementById("store_tasks2").value = "3";


});




